import { init } from "snabbdom/build/package/init";
import { h } from "snabbdom/build/package/h";

const patch = init([]);

let vnode = h('div#container.ttt', [
    h('h1', 'hello snabbdom'),
    h('p', '这是一个p')
])
let app = document.querySelector('#container')
let oldVnode = patch(app, vnode)
setTimeout(() => {
    // vnode = h('div#container.cls', [
    //     h('h2', 'hello 2s'),
    //     h('p', 'this is p')
    // ]);
    // patch(oldVnode, vnode)
    // 创建一个空的注释dom
    patch(oldVnode, h('!'))
}, 2000)